import { post ,get} from '@/utils/http';
import type { RowType } from '@/types/station';

interface listType {
  page: number;
  pageSize: number;
  name?: string;
  id?: string;
  status: number;
}

interface RevenueType {
  page: number;
  pageSize: number;
  name?: string;
}
enum Api {
  List = '/stationList',
  Edit = '/station/edit',
  Delete = '/station/delete',
  RevenueChart = '/revenueChart',
  Revenue = '/revenueList',
  CurrentList='/currentList'

}
function listApi(data: listType): Promise<any> {
  return post(Api.List, data);
}
function editApi(data: RowType): Promise<any> {
  return post(Api.Edit, data);
}
function deleteApi(id: string): Promise<any> {
  return post(Api.Delete, { id });
}
function chartApi(): Promise<any> {
  return get(Api.RevenueChart);
}
function revenueApi(data:RevenueType): Promise<any> {
  return post(Api.Revenue, data);
}
function currentListApi(): Promise<any> {
  return post(Api.CurrentList);
}
export { listApi, editApi, deleteApi ,chartApi,revenueApi,currentListApi};
